package com.itheima.ai.service;

import com.itheima.model.ai.dtos.ChatRequest;
import com.itheima.model.ai.dtos.ChatResponse;
import com.itheima.model.ai.pojos.ChatMessage;
import com.itheima.model.ai.pojos.ChatSession;
import reactor.core.publisher.Flux;

import java.util.List;

public interface ChatService {
    
    /**
     * 发送消息并获取AI回复
     */
    ChatResponse sendMessage(ChatRequest request);
    
    /**
     * 发送消息并获取AI流式回复
     */
    Flux<String> sendMessageStream(ChatRequest request);
    
    /**
     * 获取会话历史消息
     */
    List<ChatMessage> getSessionMessages(Long userId, String sessionId);
    
    /**
     * 清除会话
     */
    void clearSession(Long userId, String sessionId);
    
    /**
     * 获取用户的会话列表
     */
    List<ChatSession> getUserSessions(Long userId);
    
    /**
     * 创建新会话
     */
    ChatSession createSession(Long userId, String title);
}

